<template>
  <div style="height: 100%;">
    <keep-alive>
      <router-view  v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <router-view  v-if="!$route.meta.keepAlive"></router-view>
    <!--加载页面进行缓存-->
    <keep-alive>
        <router-view name="myLoading" v-if="getWait"></router-view>
    </keep-alive>
    <div class="pageLoad" :style="{'backgroundColor': color}" v-if="loadingState">
      <data-loading></data-loading>
    </div>
  </div>
</template>
<script>
  //  import HeaderView from 'src/pages/home/nav.vue'
  import {mapState,mapGetters} from 'vuex'
  import {Common} from 'src/utils/common.js'
  import {Storage} from 'src/utils/storage.js'

  export default {
    name: 'home',
    data: () => ({
      color: 'rgba(0, 0, 0, 0.5)'
    }),
    computed: {
      ...mapState({
        loadingState: state => state.loading.loadingState,
        url: state => state.user.url
      }),
      ...mapGetters(['getWait'])
    },
    watch: {
      '$route'(newVal, oldVal) {

      }
    },
    methods: {},
    mounted() {
      // alert(location.href)
    }
  }
</script>
